package com.market.goods.web;

import com.market.goods.dao.es.CategoryBrandDocument;
import com.market.goods.service.CategoryBrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Api(tags = "搜索相关服务")
@RestController
@RequestMapping("/search")
public class SearchController {

    @Autowired
    CategoryBrandService categoryBrandService;

    @ApiOperation("输入即搜索接口")
    @GetMapping("inputAndSearch/{queryWorld}")
    public List<CategoryBrandDocument> inputAndSearch(@PathVariable String queryWorld){
        log.info("inputAndSearch={}",queryWorld);
       return categoryBrandService.inputAndSearch(queryWorld);
    }


}
